import {Navigate,Outlet,useLocation,useRoutes} from "react-router-dom"
import { commonRouterList } from "./routeList"
import React from "react"
import lazyLoad from "./utils/lazyLoad"

import Login from "@/views/login/index"

export const rootRouter = [
    {
        path:"/",
        element: <Navigate to="/login" />
    },
    {
        path:'/login',
        element: lazyLoad(React.lazy(() => import("@/views/login")))
    },
    ...commonRouterList
]

const Router = () => {
    const routes = useRoutes(rootRouter)

    return routes
}

export default Router